The Authentication feature in Embedded Wallets simplifies account management, authentication, and session control for your application.
OAuth
token (or PlayFab ticket
), email, or as an ephemeral Guest Wallet
for providing wallet functions.
Before you can use the Sequence WaaS SDK, you need to obtain the following configuration keys from the Sequence Builder:
WaaSConfigKey
: This key can be learned about hereProjectAccessKey
: This key can be learned about hereconfig.ts
file:
idToken
(or PlayFab ticket) from the social auth method, usually looking in the form of eyJh...
if it’s an OAuth
token and pass to it the signIn
function:
guest
key set to true
, which will create an ephemeral wallet for use in the application with all Embedded Wallet functions possible.
idToken
, the email address of the user authenticated is returned in an email
property of the returned object:
sequence.onEmailConflict
that the account already exists to handle for your application. In this case, you may choose how you would like to address this:
forceCreate
function in the callback. The warning that an account already exists will be ignored and a second, separate wallet address will be created for the user that affiliated with the different login provider.onEmailConflict
callback with forceCreate
to create a second wallet for the user:
CustomId
. For example, the an example call is below:
signIn
function as a parameter to authenticate the user and create a valid session:
Invalid Verifier
error.
@react-oauth/google
package in order to generate an idToken
and pass it to Sequence:
Begin with a simple main.tsx
file that sets up the WaaS SDK, the router, and the Google OAuth provider.
GoogleLogin
component from the @react-oauth/google
package for Google authentication. Once authenticated we trigger the handleGoogleLogin
function when a user successfully logs into Google.
idToken
and pass that into the Embedded Wallet SDK.
To do this for the signed in session for web using @stytch/react
, use the following package browser-cookies
to retrieve the stytch_session_jwt
from the cookies after the callback once the redirect has been completed:
idToken
Contentsiss
(aka Issuer) (string) - The issuer of the token. For tokens from Google, this is usually a URL like https://accounts.google.com or something similiar.azp
(aka Authorized party) (string) - The client ID of the authorized presenter. This claim is used in Google OAuth 2.0 to identify the party using the token.aud
(aka Audience) (string) - Intended audience of the token. Typically, this is your application’s client ID.sub
(aka Subject) (string) - The unique identifier for the user. It is intended to be used to identify the user across multiple systems.hd
(aka Hosted Domain) (string) - It means that the user who has authenticated is from the respective domain.email
(string) - The user’s email address, as registered in the authentication service.email_verified
(boolean) (string) - A boolean representing whether the email address has been verified as genuine.nonce
(string) - A string used to associate a client session with an ID token and to mitigate replay attacks.name
(string) - The full name of the user as registered in the authentication service.picture
(string) - URL of the user’s profile picture.given_name
(string) - The user’s first name.family_name
(string) - The user’s last name.iat
(aka Issued at) (number) - The timestamp when the token was issued, represented in Unix time (seconds since Jan 1, 1970).exp
(aka Expiration time) (number) - The expiration timestamp of the token, beyond which the token should not be considered valid.idToken
Contentsiss
(string) - The issuer registered claim identifies the principal that issues the identity token. Because Apple generates the token, the value is https://appleid.apple.com.sub
(string) - The subject registered claim identifies the principal that’s the subject of the identity token. Because this token is for your app, the value is the unique identifier for the user.aud
(string) - The audience registered claim identifies the recipient of the identity token. Because the token is for your app, the value is the client_id from your developer account.iat
(number) - The issued at registered claim indicates the time that Apple issues the identity token, in the number of seconds since the Unix epoch in UTC.exp
(number) - The expiration time registered claim identifies the time that the identity token expires, in the number of seconds since the Unix epoch in UTC. The value must be greater than the current date and time when verifying the token.nonce
(string) - A string for associating a client session with the identity token. This value mitigates replay attacks and is present only if you pass it in the authorization request.nonce_supported
(boolean) - A Boolean value that indicates whether the transaction is on a nonce-supported platform. If you send a nonce in the authorization request, but don’t see the nonce claim in the identity token, check this claim to determine how to proceed. If this claim returns true, treat nonce as mandatory and fail the transaction; otherwise, you can proceed treating the nonce as optional.email
(string) - A string value that represents the user’s email address. The email address is either the user’s real email address or the proxy address, depending on their private email relay service. This value may be empty for Sign in with Apple at Work & School users. For example, younger students may not have an email address.email_verified
(string || boolean) - A string or Boolean value that indicates whether the service verifies the email. The value can either be a string (“true” or “false”) or a Boolean (true or false). The system may not verify email addresses for Sign in with Apple at Work & School users, and this claim is “false” or false for those users.is_private_email
(string || boolean) - A string or Boolean value that indicates whether the email that the user shares is the proxy address. The value can either be a string (“true” or “false”) or a Boolean (true or false).real_user_status
(number) - An Integer value that indicates whether the user appears to be a real person. Use the value of this claim to mitigate fraud. The possible values are: 0 (or Unsupported), 1 (or Unknown), 2 (or LikelyReal). This claim is present only in iOS 14 and later, macOS 11 and later, watchOS 7 and later, tvOS 14 and later. The claim isn’t present or supported for web-based apps.transfer_sub
(string) - A string value that represents the transfer identifier for migrating users to your team. This claim is present only during the 60-day transfer period after you transfer an app.